<?php
/* @var $this GiftPasswordController */
/* @var $model GiftPassword */
$this->breadcrumbs=array(
	Yii::t('base','Gift Record')=>array('index'),
	Yii::t('base','Manage'),
);


Yii::app()->clientScript->registerScript('', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#gift-password-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo Yii::t('base','Manage Gift Record');?></h1>

<?php echo CHtml::link(Yii::t('base','Advanced Search'),'#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php  $this->renderPartial('_search1',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<?php 
	if(Yii::app()->user->level() == 9 || Yii::app()->user->level() == 10){
?>

<?php }?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'gift-password-grid',
	'dataProvider'=>$model->search2(),
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pager'=>array('class'=>'CLinkPager','hiddenPageCssClass'=>'','firstPageCssClass'=>'first paginate_button','htmlOptions'=>array('class'=>'dataTables_paginate paging_full_numbers"'),'header'=>""),
	'pagerCssClass'=>'pagination',
	'cssFile'=>false,
	'template'=>'{items}{summary}{pager}',
	'columns'=>array(
		//'gift_password_id',
		'service_number',
		array('name'=>'activity_id','value'=>'GiftPassword::model()->getActivityNames($data->activity_id)'),
		'password',
		array('name'=>'state','value'=>'GiftPassword::model()->getState($data->state)'),
		'time',
		'moblie',
		array('name'=>'address','value'=>'GiftPassword::model()->getAddress($data->address)'),
		/*array(
				'class'=>'CButtonColumn',
				'header'=>Yii::t('base','Operate'),
				'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
				'updateButtonOptions'=>array('class'=>'btn btn-small'),
				'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
				'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
				'template'=>'{update}',
				'visible'=>Yii::app()->user->level() == 1,
		),*/
	),
)); ?>
